Skip to content

feat(studio): bake WebAudio synth into offline audio tracks for Codex Tetris#870

Closed
miguel-heygen wants to merge 1 commit into
mainfrom
worktree-feat-codex-tetris-baked-audio
Closed

feat(studio): bake WebAudio synth into offline audio tracks for Codex Tetris#870
miguel-heygen wants to merge 1 commit into
mainfrom
worktree-feat-codex-tetris-baked-audio

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

  • WebAudio synth (oscillators, noise channels) can't be captured by the headless renderer — it only processes file-based <audio> tracks via FFmpeg during the audio stage
  • Added bake-audio.ts that pre-renders chiptune BGM and SFX offline into WAV files using square/triangle wave oscillator math — no external deps, just bun run bake-audio.ts
  • Composition references the baked WAVs as standard <audio> elements with data-start/data-duration/data-volume, so the producer pipeline picks them up normally

Composition

1080×1920 vertical, 28s, 4 scenes:

  1. QR scan — phone mockup with deterministic QR grid, CRT scanlines, phosphor green glow
  2. Console boot — CODEX GAMING system loading bar
  3. Tetris gameplay — 10×20 board, 4 falling pieces with Penrose cursor AI, line clear flashes, score/lines/level counters
  4. Game over + attribution — final score, @HyperFrames_ / @Miguel07Code

Transitions: glitch (primary, 2×) + chromatic aberration (accent, 1×)

Test plan

  • bun run bake-audio.ts generates valid bgm.wav and sfx.wav (28s PCM WAV each)
  • npx hyperframes lint passes with 0 errors
  • npx hyperframes validate --no-contrast passes with no console errors
  • Preview in studio shows all 4 scenes with transitions and falling pieces
  • Render to MP4 includes both audio tracks in the final mix

WebAudio synth (oscillators, noise channels) can't be captured by the
headless renderer — it only picks up file-based <audio> tracks via
FFmpeg. This composition demonstrates the fix: a bake-audio.ts script
pre-renders chiptune BGM and SFX offline into WAV files using square/
triangle wave math, then the composition references them as standard
<audio> elements with data-start/data-duration/data-volume attributes.

Composition: 1080×1920 vertical, 28s, 4 scenes — QR scan → console
boot → Tetris gameplay (Penrose cursor AI, line clears, score counter)
→ game over + attribution. Glitch + chromatic aberration transitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant